import _ from 'lodash-es';
import { defineStore } from 'pinia';

const useMapStore = defineStore('storeMap', {
  state: () => ({
    mode: '2d', //二三维
    initialized: [], //初始化
    baseMapLayer: '影像图',
  }),

  actions: {
    RESET() {
      this.initialized = [];
    },
    SER_BASE_MAP_LAYER(payload) {
      this.baseMapLayer = payload;
    },
    INITIALIZE(payload) {
      this.initialized = _.uniq([...this.initialized, payload]);
    },

    CHANGE_MODE(payload) {
      this.mode = payload;
    },
  },
});

export default useMapStore;
